<!DOCTYPE html>
<html>
#{include file="header.html"}#
<body class="gray-bg">
<div class="ibox-content">
  <ul class="sortable-list connectList agile-list">
    #{foreach from=$list key=k item=v}#
    <div class="row line-h20 mr-b-5">
      <div class="col-xs-12">#{$v.msg_type}#:<a href="javascript:void(0)" class="single_operation" data-url="#{$v.url}#" data-act="view">#{$v.msg_title}#</a></div>
      <div class="col-xs-6"> <i class="fa fa-clock-o"></i>#{$v.content}#</div>
      <div class="col-xs-6 text-right"><a href="javascript:void(0)" class="btn btn-xs btn-info btn-rounded single_operation" data-id="#{$v.id}#" data-act="read">标记已读</a></div>
    </div>
    #{/foreach}#
  </ul>
</div>
</body>
</html>
<script src="#{$smarty.const.APP}#/View/template/js/content.js?v=1.0.0"></script> 
<script type="text/javascript">
$(document).ready(function () {
	$("body").on("click", ".single_operation", function() {
		message_id =$(this).attr("data-id");
		single_act =$(this).attr("data-act")
		single_url =$(this).attr("data-url")
		if(single_act=="view"){
			parent.layer.open({
				type: 2,
				title: '查看通知',
				shadeClose: true,
				fixed: false, //不固定
				area: ['90%', '90%'],
				content: single_url
			});			
			return false;	
		}else if(single_act=="read"){
			act_url="#{$smarty.const.ACT}#/sysmanage/Message/message_read/";
			$.ajax({
				type: "POST",
				url: act_url,
				data:{"message_id":message_id},
				dataType:"json",
				beforeSend: function() {
						layer.msg('数据处理中',{
									time:1000,
									icon: 16,
									shade: 0.01
								  }
								 );
				},
				success: function(data){
					if(data.statusCode=='200'){
						window.location.reload();

					}
				}
			});
		}

	});
	
	
});
</script>